package com.five.monkey.feign.es.dao.model;

import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * @author 狻猊
 * @date 2021-11-23 10:39:25
 */
@Data
@Accessors(chain = true)
@Document(indexName = "t_user", createIndex = false)
public class User {

    public User() {
        this.id = null;
        this.name = null;
        this.password = null;
        this.status = null;
        this.createTime = null;
        this.updateTime = null;
    }

    /**
     * 主键
     */
    @Id
    private Long id;

    /**
     * 用户名称
     */
    @Field(name = "name", store = true, type = FieldType.Keyword)
    private String name;

    /**
     * 用户密码
     */
    @Field(name = "password", store = true, type = FieldType.Keyword)
    private String password;

    /**
     * 用户状态。0：正常；1：已删除
     */
    @Field(name = "status", store = true, type = FieldType.Integer)
    private Integer status;

    /**
     * 用户创建时间
     */
    @Field(name = "create_time", store = true, type = FieldType.Keyword)
    private String createTime;

    /**
     * 用户信息修改时间
     */
    @Field(name = "update_time", store = true, type = FieldType.Keyword)
    private String updateTime;
}
